-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement to/from casting for extern
w/ no allocation
#2208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far! Thanks for tackling this :-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very well done!
I see you've updated the tests. Did you check the doctests too?
I'm approving the PR despites there is dbg!
calls that need to be removed :-).
/// All elements in this union must be `repr(C)` and have a | ||
/// `CApiExternTag` as their first element. | ||
#[allow(non_camel_case_types)] | ||
pub(crate) union wasm_extern_inner { | ||
function: mem::ManuallyDrop<wasm_func_t>, | ||
memory: mem::ManuallyDrop<wasm_memory_t>, | ||
global: mem::ManuallyDrop<wasm_global_t>, | ||
table: mem::ManuallyDrop<wasm_table_t>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
#[allow(non_camel_case_types)] | ||
#[derive(Clone)] | ||
#[repr(transparent)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
wasm_extern_as_
no allocationextern
w/ no allocation
bors r+ |
bors r- |
Canceled. |
bors r+ |
Resolves #2197
This should be good to go now.
The only question is how we want to deal with a breaking change this big. @Hywan and I previously discussed this, it seems other implementers of the wasm C API may have the same bug this is fixing
New Changelog rendered
Primary Changelog rendered